/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package testadventure;

import edu.clemson.cs.hamptos.adventure.AdventureCommand;
import edu.clemson.cs.hamptos.adventure.AdventureEngine;
import edu.clemson.cs.hamptos.adventure.AdventureTarget;
import edu.clemson.cs.hamptos.adventure.AdventureWindow;
import edu.clemson.cs.hamptos.adventure.VerbStrategyAlt;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Set;

/**
 *<p>Implements the <code>VerbStrategyAlt</code> interface</p>
 * 
 * @author Owen
 */
public class VerbRollBody implements VerbStrategyAlt {
    protected final HashSet<String> verbs = new HashSet<String>();
    /**
     * Constructs a new VerbRollBody type which adds the String "roll" to the 
     * <code>verb</code> hashset
     */
    VerbRollBody()
    {
        verbs.add("roll");
        verbs.add("flip");
    }

    @Override
    public void doCommand(AdventureCommand c, AdventureEngine e, AdventureWindow w) {
        AdventureTarget thedo = c.getDirectObject();
        
        HashMap<String, Integer> dostats = thedo.getStats();
        
        //see if do is defeated or still active
        if (dostats.get("enabled") == 0)
        {
            w.println(thedo.getShortDescription() + " is already rolled.");
            return;
        }
        
        w.println("You " + c.getVerb() + " " + thedo.getShortDescription() + " over.");
        thedo.listen(e, w);
    } 
        @Override
    public String getName() {
        return "VerbRollBody";
    }

    @Override
    public Set<String> getVerbs() {
        return new HashSet<String>(verbs);
    }
    }
    
    
